package com.codeczx.slidingconflictdemo;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.Gravity;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;

public class InsideConflictActivity extends AppCompatActivity {

    @BindView(R.id.view_pager)
    MyViewPager viewPager;

    List<View> mViews;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_inside_conflict);
        ButterKnife.bind(this);
        initData();
    }

    private void initData() {
        mViews = new ArrayList<>();
        List<String> datas = new ArrayList<>();
        for (int i = 0; i < 50; i++) {
            datas.add("item" + i);
        }
        for (int i = 0; i < 4; i++) {
            MyListView listView = new MyListView(this);
//            ListView listView = new ListView(this);
            ArrayAdapter adapter = new ArrayAdapter(this, android.R.layout.simple_list_item_1, datas);
            listView.setAdapter(adapter);
            mViews.add(listView);
        }
        viewPager.setAdapter(new MyPagerAdapter(mViews));
    }
}
